<?
$c = new ModuleConfig("core");

// -- Controller --

$c->setControllerConfig(
    new ControllerConfig(
        array(
            "nocache"=>"true",
            "contentType"=>"text/xml",
            "forwardPattern"=>"cms/core/view\$P",
            "locale"=>"true"
        )
    )
);



// -- MessageResources --

$c->addMessageResourcesConfig(
    new MessageResourcesConfig(
        array(
            "parameter"=>"cms/core/resource/MessageResources",
            "key"=>"php-cms",
            "nullValue"=>false
        )
    )
);

// -- FormBeans --

$c->addFormBeanConfig(
    new FormBeanConfig(
        array(
            "name"=>"fileForm",
            "type"=>"cms/core/action/file/FileForm"
        )
    )
);
$c->addFormBeanConfig(
    new FormBeanConfig(
        array(
            "name"=>"listForm",
            "type"=>"cms/core/action/AbstractListForm"
        )
    )
);
$c->addFormBeanConfig(
    new FormBeanConfig(
        array(
            "name"=>"categoryForm",
            "type"=>"cms/core/action/category/AbstractForm"
        )
    )
);
$c->addFormBeanConfig(
    new FormBeanConfig(
        array(
            "name"=>"categoryListForm",
            "type"=>"cms/core/action/category/ListForm"
        )
    )
);

// -- Global Exceptions --

$c->addExceptionConfig(
    new ExceptionConfig(
        array(
            "type"=>"Exception",
            "path"=>"/error/exception.php",
            "handler"=>"mvc/action/ExceptionHandler"
        )
    )
);
$c->addExceptionConfig(
    new ExceptionConfig(
        array(
            "type"=>"AccessDeniedException",
            "path"=>"/error/forbidden.php",
            "handler"=>"mvc/action/ExceptionHandler"
        )
    )
);


// -- Action Mappings --

$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/js/tiny_mce",
            "forward"=>"/js/tiny_mce/tiny_mce.js",
                        
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/login",
            "forward"=>"/auth/login.php",
                        
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/failed",
            "forward"=>"/auth/login.php",
                        
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/logout",
            "forward"=>"/auth/logout.php",
                        
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/screen",
            "forward"=>"/css/screen.css",
                        
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/unknown",
            "unknown"=>true,
            "type"=>"cms/core/action/error/UnknownAction"
            ,
            "forwards"=>array(
                "success"=>new ForwardConfig(
                    array(
                        "name"=>"success",
                        "path"=>"/error/notfound.php",
                        "redirect"=>false
                    )
                )
            )            
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/help",
            "validate"=>false,
            "name"=>"listForm",
            "scope"=>"request",
            "type"=>"cms/core/action/help/HelpAction"
            ,
            "forwards"=>array(
                "success"=>new ForwardConfig(
                    array(
                        "name"=>"success",
                        "path"=>"/help.php",
                        "redirect"=>false
                    )
                )
            )            
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/image",
            "validate"=>false,
            "name"=>"fileForm",
            "scope"=>"request",
            "type"=>"cms/core/action/file/FileAction"
                        
        )
    )
);
$c->addActionConfig(
    new ActionConfig(
        array(
            "path"=>"/download",
            "validate"=>false,
            "name"=>"fileForm",
            "scope"=>"request",
            "type"=>"cms/core/action/file/FileAction"
                        
        )
    )
);

return $c;
?>